import {getSupplier as getSupplierAPI} from "@/api/pointsMall";
import {ISupplierItem, IStoreGoodsPageDataOption} from "@/api/modules/pointsMall";

/**
 * 获取供应商选项列表
 * -1代表全部
 */
export function useGetSupplier() {
  const supplierList=ref<ISupplierItem[]>([])
  const getSupplier = async (data:IStoreGoodsPageDataOption) => {
    const rs = await getSupplierAPI(data)
    
    if (rs.code === 200) {
      supplierList.value = rs.payload ?? []
    }
  }
  return {
    supplierList,
    getSupplier
  }
}
